package placehandler

// ------- 网点类型相关API请求处理 placeClassHandler -------

// GetPlaceClassList 获取网点列表API
//func GetPlaceClassList(ctx *gin.Context)  {
//	// 请求参数处理
//	param := &request.BaseListReq{}
//	dingo.ErrorIf(ctx.ShouldBindQuery(param)).Unwrap()
//	// 获取数据
//	data := dao.NewPlaceClassDao().FetchPlaceClassList(param)
//	// 响应请求
//	Response(ctx)("", CodeSuccess, resp2.ListResp{
//		PageNo:     param.PageNo,
//		PageSize:   param.PageSize,
//		TotalCount: data.Val().(int64),
//		TotalPage:  0,
//		Data:       data.Unwrap(),
//	})(OK)
//}

// GetPlaceClassTree 获取列表  树型结构
//func GetPlaceClassTree(ctx *gin.Context)  {
//	lists := logic.NewPlaceLogic().GetPlaceClassTree(0)
//	Response(ctx)("", CodeSuccess,lists)(OK)
//}









// GetPlaceClassById 获取网点详情API
//func GetPlaceClassById(ctx *gin.Context)  {
//	placeClassId := &struct {
//		Id int `uri:"id" binding:"required,gt=0"`
//	}{}
//	if err := ctx.ShouldBindUri(placeClassId); err != nil {
//		Response(ctx)("GetPlaceClassById with invalid param", CodeInvalidParam,err)(Error)
//	}
//	Response(ctx)("", CodeSuccess,dao.NewPlaceClassDao().GetPlaceClassById(placeClassId.Id).Unwrap())(OK)
//}

// GetPlaceClassByPid 获取网点详情API
//func GetPlaceClassByPid(ctx *gin.Context)  {
//	placeClassPid := &struct {
//		Pid int `uri:"pid" binding:"required,gt=0"`
//	}{}
//	if err := ctx.ShouldBindUri(placeClassPid); err != nil {
//		Response(ctx)("GetPlaceClassByPid with invalid param", CodeInvalidParam,err)(Error)
//	}
//
//	log.Println(placeClassPid.Pid)
//	Response(ctx)("", CodeSuccess, dao.NewPlaceClassDao().FetchPlaceClassListByPid(placeClassPid.Pid).Unwrap())(OK)
//}

// InsertPlaceClass 新增网点信息API
//func InsertPlaceClass(ctx *gin.Context)  {
//	m := placeclass.New().Mutate(placeclass.WithCreateAt(dingo.Time(time.Now().Unix())))
//	if err := ctx.ShouldBindJSON(m); err != nil {
//		Response(ctx)("InsertPlaceClass with invalid param", CodeInvalidParam,err)(Error)
//	}
//	//m.CreateAt = time.Now()
//	Response(ctx)("", CodeInsertSuccess, dao.NewPlaceClassDao().InsertPlaceClass(m).Unwrap())(OK)
//}

// UpdatePlaceClassById 更新网点信息API
//func UpdatePlaceClassById(ctx *gin.Context)  {
//	model := placeclass.New().Mutate(placeclass.WithUpdateAt(dingo.Time(time.Now().Unix())))
//	if err := ctx.ShouldBindJSON(model); err != nil {
//		Response(ctx)("UpdatePlaceClassById with invalid param", CodeInvalidParam,err)(Error)
//	}
//	log.Println(model)
//	Response(ctx)("", CodeUpdateSuccess, dao.NewPlaceClassDao().UpdatePlaceClassById(model).Unwrap())(OK)
//}

// DeletePlaceClassById 删除网点信息API
//func DeletePlaceClassById(ctx *gin.Context)  {
//	placeId := &struct {
//		Id int `uri:"id" binding:"required,gt=0"`
//	}{}
//	if err := ctx.ShouldBindUri(placeId); err != nil {
//		Response(ctx)("DeletePlaceClassById with invalid param", CodeInvalidParam,err)(Error)
//	}
//	Response(ctx)("", CodeDeleteSuccess, dao.NewPlaceClassDao().DeletePlaceClassById(placeId.Id).Unwrap())(OK)
//}
